//huiwen digit.
#include <stdio.h>

int is_huiwen(int val)
{
    int m, sum = 0;
    m = val;
    while(m)
	{
		sum = sum*10 + m%10;
		m /= 10;//这两步的目的是让数字val位值从前往后互换 
	}
	if(sum == val)
	{
		return 1;
	}else{
		return -1;
	}
    return 0;
}

int main(void)
{
    int num;
    printf("Enter a integer:\n");
    scanf("%d[^\r\n]",&num);
    if(is_huiwen(num) > 0)
    {
        printf("%d -- huiwen\n",num);
    }
    else 
    {
        printf("%d -- not\n",num);
    }
}